package pack0602;

import java.util.Date;

//时间日期类
public class DemoC {
    public static void main(String[] args) {
        //获取到当前系统时间
        Date date = new Date();
        System.out.println(date);
        int year =date.getYear(); //计算机是以1900年为元年
        int month =date.getMonth(); //计算机中0代表1月
        int day =date.getDate();
        int hour=date.getHours();
        int minute=date.getMinutes();
        int second=date.getSeconds();
        int week=date.getDay();
        System.out.println(year+1900);
        System.out.println(month+1);
        System.out.println(day);
        System.out.println(hour);
        System.out.println(minute);
        System.out.println(second);
        System.out.println(week);

    }
}
